
<%@page import="ll.sms.web.*"%><%@ page language="java" import="java.util.*,ll.sms.pojo.*,org.json.simple.*" pageEncoding="UTF-8"%>
<%@page import="ll.sms.util.*"%>
<%


String sort = ParamUtils.getParameter(request,"sort");
String flag = ParamUtils.getParameter(request,"flag");
int index = ParamUtils.getIntParameter(request,"start",0);
int pageSize = ParamUtils.getIntParameter(request,"limit",15);
int currentPage = 1+(index/pageSize);
String currenUsername = SmsUtil.sessionHelper(session,AdminProperty.aid);
String condition  =  "where arank = 3 and acompany='"+currenUsername+"'";
int total = WebBusinessImpl.getInstance().countTable("sms_admin",condition);

String dir = request.getParameter("dir");
if(dir == null){
	dir = "ASC";
}

String orderStr = null;
if(sort != null && !sort.equals("")){
	orderStr = " "+sort+" "+dir+" ";
}
if(SmsUtil.toInt(SmsUtil.sessionHelper(session,AdminProperty.arank))!=2){
//只允许代理查看
return;
}
List<SmsAdmin> list = WebBusinessImpl.getInstance().pageQuery(SmsAdmin.class,"sms_admin",condition,currentPage,pageSize,orderStr);

String s = ExtJsonBuilder.toExtJsonString(total, list );
response.getWriter().print(s);
%>
